//
//  TMGMessagedetailViewController.m
//  TMGold
//
//  Created by Mac on 2018/3/19.
//  Copyright © 2018年 tangmu. All rights reserved.
//

#import "TMGMessagedetailViewController.h"

@interface TMGMessagedetailViewController ()
@property(nonatomic, strong) STLabel                     *nameLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@property(nonatomic, strong) STLabel                     *contentLable;
@end

@implementation TMGMessagedetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"通知详情";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    UIView * heder = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 200)];
    
    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(10, 5, UIScreenWidth - 20, 50 )];
    whiteView.backgroundColor = [UIColor whiteColor];
    whiteView.layer.cornerRadius = 4;
    whiteView.clipsToBounds = YES;
    [heder addSubview:whiteView];
    
    
    self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(10, 0, 200, 40)
                                               text:@"系统消息"
                                          textColor:FirstTextColor
                                               font:16
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    [whiteView addSubview:self.nameLable];
    
    
    self.timeLable = [[STLabel alloc] initWithFrame:CGRectMake(10, 0, whiteView.width, 40)
                                               text:self.model.create_time
                                          textColor:SecendTextColor
                                               font:16
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentRight];
    self.timeLable.right = whiteView.width - 10;
    [whiteView addSubview:self.timeLable];
    
    self.contentLable = [[STLabel alloc] initWithFrame:CGRectMake(10, self.nameLable.bottom, whiteView.width - 20, 20)
                                                  text:self.model.content
                                             textColor:FirstTextColor
                                                  font:16
                                           isSizetoFit:NO
                                         textAlignment:NSTextAlignmentLeft];
    [whiteView addSubview:self.contentLable];
    [NSString lableAutoAdjustheightWithLabel:self.contentLable];
    
    whiteView.height = self.contentLable.bottom  +10;
    
    heder.height = whiteView.bottom + 10;
    self.tableView.tableHeaderView = heder;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
